<template>
    <div class="loadInfo">
        <Card class="load_content" style="min-height: 280px;">
            <h2>贷款信息</h2>
            <div class="load_container">
                <div>
                    <span>车款</span>
                    <car-loan-discount 
                    :discountOption="carDiscountOption"
                    :carCostDetails="carCostDetails"
                    :discountList="discountList"
                    ></car-loan-discount>
                </div>
                <div v-if="isAdditional=='1'&&isSubProduct=='1'" style="margin-left: 20px;">
                    <span>附加金额</span>
                    <additional-loan-discount 
                    :discountOption="additionalDiscountOption"
                    :addCostDetails="addCostDetails"
                    :discountList="discountList"
                    ></additional-loan-discount>
                </div>
            </div>
        </Card>
    </div>
</template>
<script>
import CarLoanDiscount from "./car-loan-discount/carLoanDiscount.vue"
import AdditionalLoanDiscount from "./additional-loan-discount/additonalLoanDiscount.vue"
import {
    getDictDataByType
} from "_p/basic/api/admin/datadic.js";
export default {
    name:"loadInfo",
    data(){
        return{
            curLoan:"car",
            discountList:[],
            loanType:[
                {
                    title:"车款",
                },
                {
                    title:"附加金额"
                }
            ],  
        }
    },
    components:{
        CarLoanDiscount,
        AdditionalLoanDiscount
    },
    props:{
        isAdditional:{
            type:String
        },
        isSubProduct:{
            type:String
        },
        carDiscountOption:{
            type:String
        },
        additionalDiscountOption:{
            type:String
        },
        addCostDetails:{
            type:Object
        },
        carCostDetails:{
            type:Object
        }
    },
    created(){
    },
    watch:{
    },
    mounted(){
        this.initDiscountList()
    },
    computed: {

    },
    methods:{
        tabLoan(type){
            this.curLoan=type;
        },
        initDiscountList(){
            let param = {
                type: "subsidySideType"
            }
            getDictDataByType(param.type).then(res => {
                if (res.code === "0000") {
                    this.discountList = res.data;
                }
            });
        },
    }
}
</script>

<style scoped>
.loadInfo .load_container{
    display:flex;
    margin-top: 10px;
}
.loadInfo .load_container>div>span{
    color: #EB9620;
    font-size: 16px;
    margin-bottom: 10px;
}
.load_container>div{
    width:50%;
}
.commonB{
    font-size: 18px;
    font-weight: normal;
}
</style>